<%@page contentType="text/html;charset=UTF-8" language = "java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<html>
	<head>
		<title>JWiki 用户注册</title>
    <script language = "javascript">
    	function checkform(){
    		if(form1.Username.value==""){
    			alert("用户名不能为空！");
    			form1.Username.focus();
    			return false;
    		}
    		if(form1.Username.value.length<1||form1.Username.value.length>20){
    			alert("用户名超出了范围（1~20）");
    			form1.Username.focus();
    			return false;
    		}
    		if(form1.Password.value==""){
    			alert("密码不能为空！");
    			form1.Password.focus();
    			return false;
    		}
    		if(form1.Password.value.length<1||form1.Password.value.length>10){
    			alert("密码超出了范围（1~10）");
    			form1.Password.focus();
    			return false;
    		}
    		if(form1.name.value==""){
    			alert("姓名不能为空！");
    			form1.name.focus();
    			return false;
    		}
    		if(form1.name.value.length<1||form1.name.value.length>20){
    			alert("姓名超出了范围（1~20）");
    			form1.name.focus();
    			return false;
    		}
    	}
    </script>
		</head>
		<body bgcolor="white">
			<div align = "center">
				<font size = "4"> <h2> 用户注册信息 <h2> </font>
			</div>
			<br>
			<hr>
			<br>
			<form name = "form1" method = "post" onsubmit = "return checkform()" action="register.do">
				<table style = "font-size:9pt;" width ="320" borde = "0" align = "center">
						<c:if test="${param.error == 1}">
							<p><font color = red>已经有用户注册</font></p>
						</c:if>
						<c:if test="${param.error == 2}">
							<p><font color = red>数据库出错</font></p>
						</c:if>
					<tr align = "right">
						<td> *用户名：</td>
						<td><input name = "Username" type = "text"> </td>
					</tr>
					<tr align = "right">
						<td> *密&nbsp;&nbsp;码：</td>
						<td><input name = "Password" type = "password"> </td>
					</tr>
					<tr align = "right">
						<td> *姓&nbsp;&nbsp;名：</td>
						<td><input name = "name" type = "text"> </td>
					</tr>
					<tr align = "right">
						<td> 地&nbsp;&nbsp;址：</td>
						<td><input name = "address" type = "text"> </td>
					</tr>
					<tr align = "right">
						<td> 电&nbsp;&nbsp;话：</td>
						<td><input name = "phone" type = "text"> </td>
					</tr>
					<tr align = "right">
						<td> 邮&nbsp;&nbsp;箱：</td>
						<td><input name = "email" type = "text"> </td>
					</tr>
				<tr>
					<td width = "120" align = "right">&nbsp;</td>
					<td width = "250" valign = "top">
						<input type ="submit" value = "确认">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<input type = "reset" value = "重填">
						</td>
					</tr>
				</table>
			</form>
    </body>
</html>